<template>
  <div class="app-container">
    <!-- 功能区 -->
    <transition name="formFade">
      <el-card class="operate-container" shadow="never" v-if="showSearch">
        <el-form :inline="true" :model="listQuery" @submit.native.prevent>
          <el-form-item label="招标方式" class="form-item">
            <el-input v-model="listQuery.biddingType" clearable class="filter-item" placeholder="项目名称"/>
            <!--<el-select placeholder="请选择" style="width:100%;" clearable v-model="listQuery.biddingType"
                       class="form-select" :popper-append-to-body="false" popper-class="select-popper">
              <el-option :value="0" label="空闲"></el-option>
              <el-option :value="1" label="出租"></el-option>
              <el-option :value="2" label="停用"></el-option>
              <el-option :value="3" label="注销"></el-option>
            </el-select>-->
          </el-form-item>
          <el-form-item class="form-item">
            <el-button type="primary" size="mini" icon="el-icon-search" @click="getList">查询</el-button>
          </el-form-item>
        </el-form>
      </el-card>
    </transition>

    <div class="table_content">
      <headerSearch :showAdd="false" :examineShow="true"
                    @creRefresh="getList"
                    @throughAdd="throughAdd"
                    @refusedAdd="refusedAdd"
                    @isSearch="showSearch = !showSearch"></headerSearch>
      <!--表格渲染-->
      <el-table ref="table" v-loading="loading" :data="list" style="width: 100%;" border
                :header-cell-style="{background: '#F8F8F9',padding: '6px 0 !important',color: '#515a6e'}"
                @selection-change="handleSelectionChange">
        <el-table-column type="selection" fixed="left" width="55"/>
        <af-table-column prop="itemName" label="项目名称" />
        <af-table-column prop="biddingType" label="招标方式" />
        <af-table-column prop="biddingScope" label="招标范围" />
        <af-table-column prop="biddingUserName" label="招标提交用户名" />
        <af-table-column prop="biddingTime" label="招标提交时间" />
      </el-table>

      <!--分页-->
      <pagination v-show="total>0" :total="total"
                  :page.sync="listQuery.pageNum"
                  :limit.sync="listQuery.pageSize"
                  @pagination="getList" />
    </div>
  </div>
</template>

<script>
  import { doPost, doGet, doFile, orglistChild } from '@/api/index'
  import Pagination from '@/components/Pagination/index'
  import headerSearch from '@/components/headerSearch/headerSearch'

  export default {
    name: "proTender",
    components: {Pagination, headerSearch},
    data() {
      return {
        loading: false,
        list: [],
        total: 0,
        listQuery: {
          pageNum: 1,
          pageSize: 20,
          biddingType: '',
        },
        showSearch: true
      }
    },
    created(){},
    methods: {
      getList() {
        this.loading = true
        doPost('rectify/page',this.listQuery).then(res => {
          this.loading = false
          this.list = res.data.list
          this.total = res.data.total
        }).catch(error => {
          this.list = []
          this.total = 0
          this.loading = false
        })
      },
      handleSelectionChange(val){},
      //同意
      throughAdd() {},
      //拒绝
      refusedAdd(){}
    }
  }
</script>

<style scoped>

</style>
